#include "captureandsendad.h"
#include "CapturExports.h"

#include <stdexcept>

boost::shared_ptr<CaptureAndSendAd> CaptureAndSendAd::instance()
{
	static boost::shared_ptr<CaptureAndSendAd> captureAndSendAd(new CaptureAndSendAd);
	return captureAndSendAd;
}

CaptureAndSendAd::CaptureAndSendAd():
		m_RealObject(CreateCaptureAndSend())
{
	if(m_RealObject == NULL)
	{
		throw std::runtime_error("Create capture and send error");
	}
}

bool CaptureAndSendAd::start()
{
	return CaptureAndSendStart(m_RealObject);
}

bool CaptureAndSendAd::stop()
{
	return CaptureAndSendStop(m_RealObject);
}

bool CaptureAndSendAd::pause()
{
	return CaptureAndSendPause(m_RealObject);
}

bool CaptureAndSendAd::setSocket(SOCKET socket)
{
	return CaptureAndSendSetSocket(m_RealObject, socket);
}
